/**
 * 
 */
package hibernate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

import model.IPerson;


/**
 * @author ipeel
 *
 */
@Entity
@Table (name="person")
@Proxy (proxyClass=IPerson.class)
public class Person implements IPerson {
	private Integer id;
	private String firstName;
	private String lastName;
	private String username;
	private String password;
	
	public Person() {
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#getFirstName()
	 */
	@Column(name="first_name")
	public String getFirstName() {
		return firstName;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#getLastName()
	 */
	@Column(name="last_name")
	public String getLastName() {
		return lastName;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#setFirstName(java.lang.String)
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#setLastName(java.lang.String)
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#getPassword()
	 */
	@Column(name="password")
	public String getPassword() {
		return password;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#getUsername()
	 */
	@Column(name="username")
	public String getUsername() {
		return username;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#setPassword(java.lang.String)
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#setUsername(java.lang.String)
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	/* (non-Javadoc)
	 * @see hibernate.IPerson#toString()
	 */
	public String toString() {
		return this.firstName+" "+this.lastName;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#getId()
	 */
	@Id
	@Column(name="person_id")
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Integer getId() {
		return id;
	}

	/* (non-Javadoc)
	 * @see hibernate.IPerson#setId(java.lang.Integer)
	 */
	public void setId(Integer id) {
		this.id = id;
	}
}
